/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package fr.adama.entite.modele;

import java.io.Serializable;
import java.math.BigDecimal;
import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator;

/**
 *
 * @author mini-john
 */
@Entity
public class LigneFactureModele implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY, generator = "modellignefacture_sequence")
    @SequenceGenerator(name = "modellignefacture_sequence", sequenceName = "modellignefacture_sequence")
    private Long id;
    private String designation;
    private BigDecimal tauxBase;
    private BigDecimal tva;
    private Integer positionFacture;
    
    @ManyToOne(fetch = FetchType.LAZY, cascade = {CascadeType.PERSIST, CascadeType.MERGE})
    private ModeleFacture modeleFacture;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getDesignation() {
        return designation;
    }

    public void setDesignation(String designation) {
        this.designation = designation;
    }

    public BigDecimal getTauxBase() {
        return tauxBase;
    }

    public void setTauxBase(BigDecimal tauxBase) {
        this.tauxBase = tauxBase;
    }

    public BigDecimal getTva() {
        return tva;
    }

    public void setTva(BigDecimal tva) {
        this.tva = tva;
    }

    public ModeleFacture getModeleFacture() {
        return modeleFacture;
    }

    public void setModeleFacture(ModeleFacture modeleFacture) {
        this.modeleFacture = modeleFacture;
    }
    

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof LigneFactureModele)) {
            return false;
        }
        LigneFactureModele other = (LigneFactureModele) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }
    

    @Override
    public String toString() {
        return "fr.adama.entite.modele.LingeFactureModele[ id=" + id + " ]";
    }

    public Integer getPositionFacture() {
        return positionFacture;
    }

    public void setPositionFacture(Integer positionFacture) {
        this.positionFacture = positionFacture;
    }
    
}
